import Vue from "vue";
import VueRouter from "vue-router";
import MovieList from "../views/MovieList";
import  Home from "../views/Home";
import  MovieInfo from "../views/MovieInfo"

Vue.use(VueRouter);

const routes = [
  {
    path:"/",
    redirect: "/home"
  },
  {
    path: "/home",
    name: "Home",
    component:Home,
  },
  {
    path: "/movielist",
    name: "movielist",
    component: MovieList,
    children: [
      {
        path: "/home/movieinfo",
        name: "movieinfo",
        component: MovieInfo,

      }
    ]
  }

  ]

const router = new VueRouter({
  routes
});

export default router;
